define(['plugins/http', 'plugins/router', 'knockout', 'eventbus'], function(http, router, ko, eventbus) {
    var f = {
        list: ko.observableArray(),
        people: ko.observableArray(),
        goDetail: function(item) {
            router.navigate('#bank/' + item.id());
        },
        activate: function() {
            var self = this;
            http.get('./mock/app.bank.list.json').then(function(data) {
                ko.mapping.fromJS(data.list, {}, self.list);
            })

            eventbus.on('xxx', function(person) {
                console.log('show name !!!!');
                self.append(person);
            })
        },
        append: function(person) {
            var self = this;
            var people = ko.mapping.toJS(self.people);
            person = $.extend({}, { id: 1234, title: '观众XXX-list' }, person);
            people.push(person);
            ko.mapping.fromJS(people, {}, self.people);
        }
    }
    return f;
});